<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="target" style="width: 100px; height: 200px; display: inline-block"></div>
<script src="resources/parsing-test-helper.js"></script>
<script>
expect = expect.bind(this, 'rotate', 'rotate');

expect('initial').parsesAs('initial').isComputedTo('none');
expect('inherit').parsesAs('inherit');

expect('none').parsesAs('none').isComputedTo('none');
expect('10deg').parsesAs('10deg').isComputedTo('10deg');
expect('0 0 1 10deg').parsesAs('10deg').isComputedTo('10deg');
expect('-1.5 2 3 10deg').parsesAs('-1.5 2 3 10deg').isComputedTo('-1.5 2 3 10deg');
expect('45deg 1 2 3').parsesAs('1 2 3 45deg').isComputedTo('1 2 3 45deg');

expect('x 45deg').parsesAs('x 45deg').isComputedTo('x 45deg');
expect('45deg x').parsesAs('x 45deg').isComputedTo('x 45deg');
expect('y 45deg').parsesAs('y 45deg').isComputedTo('y 45deg');
expect('45deg y').parsesAs('y 45deg').isComputedTo('y 45deg');
expect('z 45deg').parsesAs('45deg').isComputedTo('45deg');
expect('45deg z').parsesAs('45deg').isComputedTo('45deg');

expect('200grad').parsesAs('200grad').isComputedTo('180deg');
expect('1rad').parsesAs('1rad').isComputedTo('57.2958deg');
expect('0 2 0 0.25turn').parsesAs('y 0.25turn').isComputedTo('y 90deg');

expect('calc(1turn - 270deg)').parsesAs('calc(90deg)').isComputedTo('90deg');
expect('0 calc(0.5 + 0.5) 1 calc(1turn - 270deg + 400grad)')
    .parsesAs('0 1 1 calc(450deg)').isComputedTo('0 1 1 450deg');

expect('2').isInvalid();
expect('1 2deg').isInvalid();
expect('1 2 45deg').isInvalid();
expect('1 2 3 4 45deg').isInvalid();
expect('10%').isInvalid();
expect('0 0 1 10%').isInvalid();
expect('calc(1 + 2)').isInvalid();
expect('calc(20deg) 0 0 20deg').isInvalid()
</script>
